package routes

import (
	"gin-elas-student-info/controllers"
	"github.com/gin-gonic/gin"
)

func SetupRoutes() *gin.Engine {
	r := gin.Default()
	studentController := controllers.StudentController{}
	api := r.Group("/api")
	{
		students := api.Group("/students")
		{

			students.POST("/", studentController.CreateStudent)
			students.GET("/:id", studentController.GetStudent)
			students.PUT("/:id", studentController.UpdateStudent)
			students.DELETE("/:id", studentController.DeleteStudent)
			students.GET("/search", studentController.SearchStudents)
			students.GET("/all", studentController.GetAllStudents)
			students.GET("/search/advanced", studentController.SearchByConditions)

		}
	}
	return r
}
